package kp.rpc.config;

import kp.rpc.cache.key.CustomCacheKey;
import kp.rpc.fault.retry.key.RetryStrategyKey;
import kp.rpc.fault.tolerant.key.TolerantStrategyKey;
import kp.rpc.loadbalancer.key.LoadBalancerKey;
import kp.rpc.serializer.key.SerializerKeys;
import lombok.Data;

/**
 * RPC 框架配置
 */
@Data
public class RpcConfig {

    /**
     * 名称
     */
    private String name = "kp-rpc";

    /**
     * 版本号
     */
    private String version = "1.0";

    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";

    /**
     * 服务器端口号
     */
    private Integer serverPort = 38080;

    /**
     * 模拟调用
     */
    private boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;
    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();
    /**
     * 负载均衡key配置
     */
    private String loadBalancer = LoadBalancerKey.ROUND_ROBIN;
    /**
     * 重试策略key配置
     */
    private String retryStrategy = RetryStrategyKey.NO_RETRY;

    /**
     * 容错策略key配置
     */
    private String tolerantStrategy = TolerantStrategyKey.FAIL_FAST;

    /**
     * 默认缓存配置
     */
    private String cache = CustomCacheKey.CAFFEINE;


}